define(["app","js/patient/patientListView","js/init", 'js/utils','js/util/toast','js/util/socketUtil','js/risk/riskModel',"text!app/risk/main.html"], 
	function(app, patientView,base,Utils,toast,initSocket,model,source) {
	
	
	var $$ = Dom7;
	var bindings = [		
		//类型链接
			
	];
	

	function init(query){	
		
		
		if(!app.mainView){
			app = app.getApp();
		}
		
		var deptid
		if(query.deptid){
			deptid = query.deptid
		}
		
		
		$.ajax({
			url	: base.base + base.appBase +'/medical/getCurrentPatient.m',
			data: {deptid:deptid,userid:app.getUserid()},
			ansyc: false,
			success: function(data){
				if(data && data.length>0){
					patientView.render({
						f7		: app.f7,
						model	: data
						//bindings: bindings
					});
				}				
			}
			,
			error:function(){
				
				
				app.f7.hidePreloader();
				toast.show({msg:'数据加载失败！'})
			}
		})		
		
		
		//var _el = $('#risk-page .type-link')
		//$(_el).unbind('click')
		//$(_el).bind('click',clickType);
	}

	return {
		init: init
	};
});